class Solution {
public:
    vector<int> sortedSquares(vector<int>& nums)
    {
        vector<int> ans;
        for (int i = 0; i < nums.size(); i++)
            ans.push_back((int)pow(nums[i], 2.0));
        ranges::sort(ans);
        return ans;
    }
};